var $table = $('#boot_table'),
    $remove = $('#remove'),
    selections = [];

function initTable() {
    $('#boot_table').bootstrapTable({
        idField:"dbid",
        pagination: "true",
        sidePagination:'server',
        url :'/jxkh/worklog/wdzblist.json?type='+$("#type").val(),//考官列表
        height: getHeight(),
        columns: [
            {
                title: '序号',
                field: 'Number',
                align: 'center',
                formatter: function (value, row, index) {
                    var page = $('#boot_table').bootstrapTable("getOptions");
                    return ((page.pageNumber-1)*page.pageSize)+index+1;
                }
            }, {
                title: '起始时间',
                field: 'workstartdate',
                align: 'center',
                valign: 'middle'
            }, {
                field: 'workenddate',
                title: '结束时间',
                align: 'center'
            }, {
                field: 'workitem',
                title: '工作内容',
                align: 'center'
            }
            , {
                field: 'operate',
                title: '操作',
                align: 'center',
                formatter: function(value, row, index){
                    return  '<a class="remove" href="javascript:deleteData('+row.dbid+')" title="删除">删除</a>'
                        + '&nbsp;&nbsp;'+'<a class="remove" href="javascript:addLog('+row.dbid+')" title="编辑">编辑</a>';
                }
            }
        ]
    });
}
function getHeight() {
    return $(window).height() - $('h1').outerHeight(true)-38;
}

function deleteData(dbid){
    layer.confirm('确认删除?', {icon: 3, title:'提示'}, function(index){
        layer.close(index);
        $.ajax({
            url:"/jxkh/worklog/deleteData/@.json".replace("@",dbid),
            success:function(data){
                search0bj();
                showMessage("操作成功！");
            }
        })
    });
}